package com.uliky.shouyiLibrary.ware.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@EnableTransactionManagement
@MapperScan(value = "com.uliky.shouyiLibrary.ware.dao")
public class WareMybatisConfig {
    //引入分页插件
    @Bean
    public PaginationInterceptor mybatisPlusInterceptor() {
        PaginationInterceptor interceptor = new PaginationInterceptor();
        //设置请求页面大于最大页后,调回首页
        interceptor.setOverflow(true);
        //每页最大限制数,默认500
        interceptor.setLimit(1000);
        return interceptor;
    }
}
